#include "DatabaseException.h"

#include "Ext/FilterQuery.h"
#include <string>

namespace TCServer
{
	namespace Store
	{
		DatabaseException::DatabaseException(const FilterQuery &query, const QString &type)
			: std::exception(QString("DatabaseException.%1 :\n"
				"\tError descript   : %2\n"
				"\tSql Expression : %3\n")
				.arg(type)
				.arg(query.lastError().text())
				.arg(query.executedQuery()).toLocal8Bit().constData()),
			sql(query.executedQuery()), error(query.lastError())
		{
		}
	}

}